#pragma once
#include "glm.h"
#include "ObjectLoader.h"
#include "common.h"






int sign( float x );

void getLightingSample(vector3 *normals,int map_size);
vector3 TransformUVtoDir( float u, float v);
vector3 TransformUVtoDirAll( float u, float v);
vector3 LocalToGlobal(const vector3 local,const vector3 g_normal);
Color GetSampleByVector(const vector3 vec);

void initNormalSampleMap(vector3 *normals,int map_size);

void HaarTransformStep( Color *src, unsigned short dim, unsigned short srcStep );
void HaarTransform2D(Color *src,int size );

void getVisibilitySample(int map_size);
void getVisibilitySample2(ObjectModel *object,int map_size);


void HaarTransformStep( GLfloat *src, unsigned short dim, unsigned short srcStep );
void HaarTransform2D(GLfloat *src,int size );

#ifdef GLM
void BuildKDTree(GLMmodel *object);
#else
void BuildKDTree(ObjectModel *object);
#endif


void testSample(int map_size);
void testVisibilitySample(int map_size);

void loadLightingSample(int map_size);
void PreCompute(GLMmodel *object,Color *vertColor);
void PreCompute2(ObjectModel *object,Color *vertColor);
void drawObject(GLMmodel *model,Color *vertColor);
GLuint getDrawList(GLMmodel *object,Color *vertColor);
